package com.imooc.bilibili.service.impl;

import com.imooc.bilibili.dao.UserCoinsInfoDao;
import com.imooc.bilibili.service.UserCoinsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("userCoinsService")
public class UserCoinsServiceImpl implements UserCoinsService {

    @Autowired
    private UserCoinsInfoDao userCoinsInfoDao;

    @Override
    public Integer getUserCoinsAmount(Long userId) {
        return userCoinsInfoDao.queryCoinsAmountByUserId(userId);
    }

    @Override
    public void updateUserCoinsAmount(Long userId, int i) {
        userCoinsInfoDao.updateUserCoinsAmount(userId,i);
    }
}
